﻿cmake_minimum_required (VERSION 3.8)

project ("BoostTCPServer")

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5 COMPONENTS Core Gui Widgets Network REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)

file(GLOB HEADERS src/*.h ${CMAKE_SOURCE_DIR}/include/*.h)
file(GLOB SOURCE_FILES src/*.h src/*.cpp)
file(GLOB FORMS src/*.ui)

# 设置生成的项目筛选器
source_group("Header Files" FILES ${HEADERS})
source_group("Source Files" FILES ${SOURCE_FILES})
source_group("Form Files" FILES ${FORMS})
source_group("Translation Files" FILES ${TRANSLATIONS})

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# 将源代码添加到此项目的可执行文件。
add_executable (${PROJECT_NAME} WIN32 ${HEADERS} ${SOURCE_FILES} ${FORMS} ${HEADERS})

set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}")
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Network)
target_link_libraries(${PROJECT_NAME} Boost::system)
# TODO: 如有需要，请添加测试并安装目标。